#!/usr/bin/env bash

MOD_NAME=boost_semantic_graph
PY_DIR_LIB=/sw/lib/python2.5
PY_DIR_INCL=/sw/include/python2.5


rm -f ${MOD_NAME}_wrap.cpp
swig  -c++ -python -cpperraswarn -o ${MOD_NAME}_wrap.cpp -I/usr/include  -I/sw/include ${MOD_NAME}.i
rm -f ${MOD_NAME}.o
gcc  -fPIC   -c ${MOD_NAME}.cpp -o ${MOD_NAME}.o -I${PY_DIR_INCL} -I/sw/include/
rm -f ${MOD_NAME}_wrap.o
gcc  -fPIC  -c ${MOD_NAME}_wrap.cpp -o ${MOD_NAME}_wrap.o -I/sw/include/ -I${PY_DIR_INCL}
rm -f _${MOD_NAME}.so
gcc -bundle -flat_namespace -undefined suppress  ${MOD_NAME}.o  ${MOD_NAME}_wrap.o  -lstdc++ -o _${MOD_NAME}.so
